package cn.bluedot.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.bluedot.bean.PageBean;
import cn.bluedot.dao.FormulaDao;
import cn.bluedot.model.FeedSet;
import cn.bluedot.model.PigFormula;
import cn.bluedot.service.FeedService;
import cn.bluedot.util.PageBeanFactory;
@Service
public class FeedServiceImpl implements FeedService{
    @Resource
    private FormulaDao formulaDao;
    
    @Override
    public PageBean<PigFormula> getPigFormula(String page) {
        //从工厂中创建一个对应的页面设置PageBean
        PageBean<PigFormula> pb = PageBeanFactory.getPageBean(page, 5);
        
        pb.setTableData(formulaDao.getPigFormula(pb));
        
        return pb;
    }

    @Override
    public PageBean<FeedSet> getSetFeeds(String page) {
      //从工厂中创建一个对应的页面设置PageBean
        PageBean<FeedSet> pb = PageBeanFactory.getPageBean(page, 5);
        
        pb.setTableData(formulaDao.getSetFeeds(pb));
        
        return pb;
    }

}
